<?php 


/** 
***************************************************
*欢迎使用免费版xSite企业自助建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.php.net.cn/xsite/ 
***************************************************
**/




if(!defined('IN_SITETEAM')) { exit('Access Denied'); } $chmod_setting = array(); $chmod_setting['./php.net.cn/xsite/include/domain.php'] = 0; $chmod_setting['./attachments'] = 0; $chmod_setting['./php.net.cn/xsite/data'] = 0; $chmod_setting['./php.net.cn/xsite/data/setting'] = 0; $chmod_setting['./php.net.cn/xsite/data/cache'] = 0; $chmod_setting['./php.net.cn/xsite/data/log'] = 0; $chmod_setting['./php.net.cn/xsite/data/version.txt'] = 0; $chmod_setting_pass = true; foreach ($chmod_setting as $k => $v) { if (is_dir($k)) { if ($dh = @opendir($k)) { closedir($dh); } else { $chmod_setting_pass = false; break; } } else { if ($fp = @fopen($k, "rb+")) { fclose($fp); } else { $chmod_setting_pass = false; break; } } } if (!$chmod_setting_pass) { echo "网站无法管理，请务必核对以下文件是否有“可读、可写”的属性：<br /><br />"; foreach ($chmod_setting as $k => $v) { echo "{$k}<br />"; } exit(); } $chmod_setting = array("index", "admin", "tool"); if (!@rename('./php.net.cn/xsite/data/admin.login.ip.txt', './php.net.cn/xsite/data/admin.login.ip.txt')) { echo "网站无法管理，请务必将网站根目中的以下文件设有“可读、可执行”的属性：<br /><br />"; foreach ($chmod_setting as $k => $v) { echo "./{$v}.php<br />"; } exit(); } if (!empty($_POST['dosubmit']) && !empty($_POST['password'])) { ob_start(); @session_start(); if (defined('SITE_CAPTCHA') && SITE_CAPTCHA) { if (!isset($_SESSION['captcha_code']) || $_SESSION['captcha_code'] == '') { message("xsite.php?action=login", "验证码不能为空"); } if ($_POST['captcha_code'] != $_SESSION['captcha_code']) { $_SESSION['captcha_code'] = ''; message("xsite.php?action=login", "验证码不正确"); } $_SESSION['captcha_code'] = ''; } if ($_POST['password'] == $domain[$site_url]['password']) { $_SESSION['loginid'] = true; } else { @session_destroy(); ob_end_flush(); message("xsite.php?action=login", "密码不正确"); } $fp = fopen(SITE_ROOT . "/data/admin.login.ip.txt", "a+"); fwrite($fp, "\n" . remote_ip()); fclose($fp); if (defined('XSITE_MU') && defined('SITE_HOST')) { $db->query("UPDATE xsite_cloud SET site_login_num = site_login_num + 1, site_action_time = '" . time() . "' WHERE site_id = '{$site_id}'"); } if (!check_db_structure($site_id)) { exit('系统无法操作，数据库系统初始化失败！'); } ob_end_flush(); if (!file_exists("install.ok")) { fclose(fopen("install.ok", "w")); } message("xsite.php?action=index"); } else { include SITE_ROOT . "/admin/tpl/login.tpl.php"; exit(); } ?>